﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FilmAlert.Common;

namespace FilmAlert.Common
{
    public class Film
    {

        #region Variables

        private Int32 _filmId;
        private Int32 _imdbId;
        private Int16 _year;
        private String _title;
        private String _imbdTitle;
        private List<String> _languages;
        private List<Director> _directors;
        private List<Actor> _actors;
        private Boolean _tvFilm = false;

        #endregion

        #region Methods

        public Film()
        {
        }

        public Film(Int32 imdbId, String imdbTitle)
        {
            _imdbId = imdbId;
            _title = _imbdTitle = imdbTitle;

            //Clean title
            _title.Replace("(V)", "");

            //TvFilm & clean title
            if (_title.Contains("(TV)"))
            {
                _tvFilm = true;
                _title.Replace("(TV)", "");
            }

            _year=Helpers.RemoveYearFromTitle(ref _title);

            _title = Helpers.ConvertFilmTitle(_title);

        }

        public Film(Int32 imdbId, String imdbTitle, Int16 year, Boolean tvFilm)
        {
            _imdbId = imdbId;
            _title = _imbdTitle = imdbTitle;
            _year = year;
            _tvFilm = tvFilm;
        }

        #endregion

        #region Properties

        public Int32 FilmId
        {
            get
            {
                return _filmId;
            }
            set
            {
                _filmId = value;
            }
        }

        public Int32 ImdbId
        {
            get { return _imdbId; }
            set { _imdbId = value; }
        }

        public String ImdbTitle
        {
            get
            {
                return _imbdTitle;
            }
            set
            {
                _imbdTitle = value;
            }
        }

        public String Title
        {
            get
            {
                return _title;
            }
            set
            {
                _title = value;
            }
        }

        public Int16 Year
        {
            get
            {
                return _year;
            }
            set
            {
                _year = value;
            }
        }

        public List<String> Languages
        {
            get
            {
                return _languages;
            }
            set
            {
                _languages = value;
            }
        }

        public Boolean TvFilm
        {
            get
            {
                return _tvFilm;
            }
            set
            {
                _tvFilm = value;
            }
        }

        public List<Actor> Actors
        {
            get
            {
                return _actors;
            }
            set
            {
                _actors = value;
            }
        }

        public List<Director> Directors
        {
            get
            {
                return _directors;
            }
            set
            {
                _directors = value;
            }
        }


        #endregion
    }
}